/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jeck.action.cu_enter.data;

import com.jeck.conexion.Conector;
import com.jeck.tools.Event;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author bicho
 */
public class Mg_welcome {

    public static List inlistEventos() {
        List events = new ArrayList<Event>();
        Conector cn = new Conector();
        ResultSet rs = cn.Consultar("SELECT * FROM eventos_actuales;");
        try {
            while (rs.next()) {
                events.add(new Event(rs.getString("nombre"), rs.getString("descripcion"),rs.getInt("id_evento")));
            }
        } catch (SQLException ex) {
            Logger.getLogger(Mg_welcome.class.getName()).log(Level.SEVERE, null, ex);
        }
        return events;
    }
}

